class Solution {
    public boolean isPalindrome(String s) {
        //遍历一次字符串，然后将其放入可变字符中
        // System.out.println((int) 'z' + ", " + (int) 'Z' + ", " + (int) '9');
        StringBuilder sb = new StringBuilder("");
        for(int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if((48 <= c && c <= 57) || (97 <= s.charAt(i) && s.charAt(i) <= 122)) {
                sb.append(c);
            }
            if(65 <= c && c <= 90) {
                sb.append((char) (c + 32));
            }
        }

        // System.out.println(sb.toString());

        boolean flag = false;
        int l = 0, r = sb.length() - 1;
        while(l < r) {
            if(sb.charAt(l) != sb.charAt(r)) {
                return false;
            }
            l++;
            r--;
        }

        return true;
    }
}